added conditional for password retrieval path
fixed syntax