remove resource logic