fixed error in error handling of dmatch