fixed kwparameter related bug in visit code