Added handling to try and make selenium tests less flaky