Fix process don't exit when error occurs