query is now sent to log before getting executed

this was needed to find errors in wrong querys
implemented further methods