raise exception when wrong format