fixed error handling bug

removed unnecessary macro