Update ipls with better logic