fixed handling of long-running queries and reviewed jobs process