same function endWith general