fixed printType function