bugfix
flatten
dereference