handle type conversion