Adding onEnter and onExit methods