added quit function