adjusted crab animation handling in code