fixed an undefined error