fix error with type changing