amend implementation by using xpath