using $timeout to do angular apply/digest