change get_queued_filename to get_orig_filename and modified function