check for error