fix a potential crash while changing algorithm