takeFocus function added