begin to deal with database interface