fixed issue with not resetting stream to its initial position after copying