fix issues with rebuilding selection too often