fix warning of substr