fix to handle paths longer than 256 characters