now seems to work fine. Also implemented per-username caching.