added enter and exit features to state