cast for some primitive types