refactor: handle undefined container variable