changed detection logic