fixed resource setting in constructor