Update controller thread and added header file for control.c