correct free() to actually work; compile before commiting