fix pathname check