type conversion safety check