fixes errors thrown when config.data_order is function

prevented calling toLowerCase on function.