fixed bug with flatten