Removed commenting within query and thread as it seems to throw the engine