fixed bugs in tracking