check for errors