Error checking in history macro