functionality of edit