fix a bug when going upwards, in whenCollide function