added a closeDecoder() for memory management