write & close functions added