add edit buttons and function