exit functionality

updated