fixed an error with dom parsing