added check for file already wrapped