fixed error mismatch bug