 		   with BannedIps  as 
 		   (
 		     select ROW_NUMBER() over (order by Mask) as RowNum, Mask 
-			 from  [{databaseOwner}].[{objectQualifier}BannedIP]
+			 from  [{databaseOwner}].[{objectQualifier}BannedIP] where BoardID=@BoardID
 		   )
 		   select
 		    a.*,

            LastUserDisplayName = IsNull(c.LastUserDisplayName,(SELECT x.DisplayName FROM [{databaseOwner}].[{objectQualifier}User] x where x.UserID=c.LastUserID)),
            LastMessageID = c.LastMessageID,
            LastTopicID = c.TopicID,
            TopicFlags = c.Flags,
            c.Priority,
            c.PollID,

               (SELECT top 1 LastAccessDate FROM [{databaseOwner}].[{objectQualifier}TopicReadTracking] y WHERE y.TopicID=c.TopicID AND y.UserID = @UserID)
             else ''	 end,
             c.TopicImage,         
            0 as HasAttachments,          
            PageIndex = @PageIndex,   	
			@TotalRows as TotalRows			       
			from
