fix bug - init attribute correctly after refreshing