code refactor for query checks #12
bugfix when trying to access a class' __init__ function
bugfix when trying to write an error file with an invalid filename