added rewind statement for multiple decodes