Adding exit mechanism by pressing 1