Removed some unnecessary state changes