fix endsWith compability