adding getScreenshot function