use database to check