avoid double calculation and calculate under release build