db connection fixes