Corrected little bug when no state_id was defined