added is_array helper function