fix bugs, allow data for edit mode