fixed bug in query_process. improved watchdog