Checked for null format in wrong place