had to use file close on new querys or app crashes, works now