try handling quit better