added ready/error file handles to shutdown