Fixed the query issue for lists