Fixed completed_job_info() to work only with queries with phase COMPLETED. Think about creating a function which returns information for queries with other phases, e.g. ERROR.