fixed bugs in control