[IMP]Improved code to fix error.