fixes to database and redis