db connection fix from workling master