patch correcting the logic