removing cout logging and moving config.h only if db connection