Removed unnecessary is_object() check