Fixed a used before defined warning