changing the syntax of cfg_register_ctx() function