Fixed bug when encountering an unknown error