fix change detection logic; add specs