Dev Removed unused session variable. Removed SQL query in favor of AR.