fix changes went in optimising resource usage