fixed decoding of binary file