Added security for store/replace inputStream;