fixed issue in the endsWith