updated to work better with network shares