fixed the hit detection