setup for chaining function