"x.type" should not be used. It should be "x.class"
Luke101: Thank you for your observation..I am sure the author will take note of it