fix undefined variable using