change database to sqllite, add login method