last_seen field and middleware