Fix security bug + improve UI logic on home screen