Small fix for Edit function