Added is_object check