created quit function