add set_opt and get_opt methods