fix bug about the not exiting elements