fixed corrupted file issue when saving on server - 2