update scratch using path for better performance