some error checking on calcium.template