Added write to file