fixed collision checking