Updated logic to fix and initialization issue.