working more on the automatic mode to add some more things, and fixed a bug with the timeout at the beginnign