change implementation of add attribute. Before it has a bug, when you add an object it will be stored as string, fix this issue use JSON.parse