only free once, fix syntax issues