fixed bugs in last commit