Finally fixed resource rules