Fixing file save bug