database interface working