make chain function chainable