fixed the rudamentary collision detection