Added password check and hash function in databaseController