fix error with type returning null