added quit handler