changed storedAttributes to attributes.