implemented xpath exception handling