fix for failing database connection after several requests