fixed bug: reading wrong mode value