It used to check if an upload record exists, which is wrong because an invalid upload record exists even if the upload was not created. The other improvement is a better log message.