free() bug fixed