Added program timeout handling