Fix an issue where attributes is not always serializable hash