Fixing broken directory in js