fork flatten from underscore