A hack or fix to overcome  java.io.StreamCorruptedException: invalid type code temporarily