rework url db handling
fix db bugs