Made resource defined before it is used and new format of notify resource