fix bug in union implementation (missing return)