Updated code ivm crashes