Exit functionality slightly changed