add flatten dependency