proper Write func