added getInstanceOf method