before db connection