fix the endless attack issue