Made it so that it can write to file succesfully.