added debug to control script