Moved the xattr setting and added code to make sure that we set