MOB-24: Added code to write back to the file