add exception handling for expect calls and change execute calls to expect