Add exit functionality