fix undefined vars