Subaru legacy gt waggon 1996

1996-Subaru Legacy wagon
I have a Subaru legacy gt wagon 1996 ej20 engine, the car works fine when its warmed up , but if i just turn it on normally it’ll idle very roughly with low revs for like 3-5 seconds then turn off, unless I hold the key turned so it forces the car to stay on and allows the revs to go normally. After Ive held the key for like 20 seconds I can let go of the key and from then on well its warmed up it’ll work fine until Ive left it for a long time again, though on repeat of the holding key in turned on position it’ll work. the starter motor has also very recently been changed and I did take off the IAC and try clean it but couldn’t get the top part off too manually twist the valve when cleaning. also cleaned the maf sensor.