fix possible undefined variable