Improved collision check