Fix unbound local error