change Wrap() to return error