Makes the edit button work correctly