Working with attributes
Fixed sWriter not being closed & causing race condition