fix not quiting when encountering an error