better database uri handling