fixed bugs in new system