fixed reduce on empty set error