Added option to save user credentials to database