updated selenium implementation