fixed unset variable issue