Fixed undefined variable error.