check if error and bail earlier