added template error code