fix bugs in to
merge