added returns on errors