moved PDO creation inside config.class + bug fix

moved PDO creation inside config.class + bug fix