Fixed a bug with saving data (even if there was no new data)