bugfix for properly decoding file