add some debug info and change the acquirements of inputstream