Removed useless code and reverted state to while from spawn