replaced all is_object calls with a version that also accepts associative array