added some timeouts logic