with database connection