fix bugs in last commit