flatten some expression
bug fix