added extra check in define