Removed unnecessary SQL queries when checking activation