macro error checking