[fix] JS error with undefined variables.