fixed bug for collision