fix bug to don't erase file