fix closure pattern for file callbacks