use database to check while log in