bug fix when using logger in cgi
added more flexibily for querying object, work in progress