Add js for refresh(state change)