fixed resource bug