Adapted to new screenshot function.