Better stop() function 

stop() now checks for whats running and then closes each one of the running modules