Modify exit method