added enter exit logica