use hasChanged to detect model change