Replaced finishedjobinfo with a database query.
Removed temp file.