A bound for the locating chromatic number of trees