nit: revoke the object URL at the very start of the function