working on takecontrol function