changed api from pipe to wrap