fixed file extension detection