fix write arg check