fixing error in return locations