Implemented the reset password functionality