fixed err catch