changed config.after_initialize callback to config.before_initialize