the first version with database