fix alternating closing issue

@0xF013 would `scope.$apply()` not suffice here?