added assertions for the result of the function for pipe creation.