fix bad type returning function