adding functionality for edit