fixed some issues with collision detector