fixed bug with database interface