added timeout to getScreenshot