finished db routine