fixed a bug while adding an attachment(thanks http://weibo.com/u/1738440993).