fixing bug while opening file in gui

bug added file content multiple times