bug fixed for collision