made db connection more robust

Signed-off-by: Sweil <mail@sweil.de>