Feature/en 1889

You should close the outputstream inside this method