Fix unset variable error