Resource save function bug fixed