modified the caching method in EWSM class.