removed bug: reading wrong mode value