Fixed memory leak in file manager