Fixing alarms query to use session.