Forgot to require logger
Added a timeout block for infinite loops