added lock to scan-to-sandwich-pdf