using integer instead of boolean
creating query collection file
on error use of console.error