fix mac quit handler