reading working for primitive types