fix the issue about multiple $apply().