Adds missing return in error check