handle set_opts properly, add new flags