fixed crash on undefined variables