fixed small bug where empty value was being passed to format function