Fixed collision check bug