Removed "wait_until_active" function as it's no longer needed.