added custom expected condition
added wait to use custom expected conidition