Fixed code for Edit

Fixed the code for the edit that was not working.