Added a timeout mechanism that resets the cube after 30 seconds.