fixed the bugs in last version