fix small bug with write hook

file extension is only set if it isn't already overridden by
a roots extension