replaced getType() with type()