set resources dir automatically