Moved file open/close out of the init/destroy. It was causing issues. This was the easiest approach to solve the problem