fix bugs in handling hitbox