todo : change implementation of timeOut in main class