need to wait till the ajax returns to change the light status