stops data stream correctly before exit
skips invalid data without 'VSSP' mark
code refactoring