Fixed the second query