fixed bug in substitution visit, incorrect field given in insert statement