added tests for db