added message boxes for success and failure of write