added in enter and exit state function calls