Fix issue with resource state handling