Fix assertion  error