use angular  instead of setTimeout