add position to endsWith