added register logic and password hashing