refactored to only one if not error function
refactored created open page method
search by query on list agreements page