figured out why write was not writing