Edited the query, but getting errors