fix for undefined variable error