fixed returns on errors