logic Implementation of exit base button