Effects of mass change on gravitational force