added password encoding