made add each-able by checking for function type