fix util function endsWith