Fix for unbound local variable