close, sleep, and reopen on errors.
added .gitignore