add error handling for EPERM on windows