update integration routine
fixed small error