added check for object type