add subtitle type check
Remove unused functions