1. fix an add or edit mode bug