adds chaining ability for functions