added checking for null pointer in new_Assoc function