fixed exit problems