clean up sidebar logic, ensure a session value for types is always set