fixing bug with invoke not being returned