fixes exit in delete_session