$timeout will be used instead of setTimeout