Fixed broken screenshot function