fixed the case when hyphen is last symbol