modified the logic for caching active user