added more fancy stuff, query error exception, and additional data