Fix deserialiser so it can work scala