solve the bug that app will crash when delegte or insert a item

solve the bug that app will crash when delegte or insert a item