Fixed bug in generating IDS