new etag support and small code fix