fixing some undeclared variables