reinstated old code and fixed the issue