fix bad union function