Fixed bug in query at thread.php model, created a filter method both for threads and comments model