adding na.rm to sum_type function