How to deal with feeling guilty...

I am going through a divorce and when I have my son there's days he just is acting out so bad. So rude. And just disrespectful it makes me so upset. I discipline but also I try understanding that his life is so confusing right now so I try being calm. The times I do discipline I feel guilty that the little time I have with him im frustrated... how do I change this feeling? BTW his dad is not the best with respect either. So he gets alot of that with him.