fixed a bug with updating user's profile
cleaned up emailer code