added control handler and updated controll code to work with remote controll