Fix directory bug on Firefox