fix angular apply issue in timeout