fix undefined variables in frontend