fixes error with not passing error to next