Fixed error when dispose is called before update