Correcting loading query