Fixed bugs with edit profile redirection

The edit profile page no longer saves data to the DOM model if a user
clicks the cancel button or redirects to a different page manually.