logic change for front end

change logic for edit page and add new item page