Added password encoding when registering