tweak params; fix a bug