Fixed an error where the program would throw a null exception
if the query was not found.