Added exit functionality