fixes undefined variable error