fixed Angular scope/apply issue