minor changes
fixed ref_count bug by adding the end_of_assignment flag