Moved filterqueries code into init function to avoid function not found error.