need to check binary write, work on amf