Add nullcheck and format_values into utils