add postexpand parameter; fix inpanding