now using insert and update commands for the selected buttons