fixed big bugs in last commit