better check for setting resource