moved pr number parsing before error check