fixed crash when trying to attach file