fixed ui logic and add edit/delete button.