Fixed possible undefined variable