Using semaphores to prevent sending diffenerent commands at the same time.
Added a function to put everything to off in the webpage