write method added