fix hit detection bug