fixing flatten method from issue