Added timeout to run loop when waiting for the signal file (resolves #7)