fix undefined variables
replace hard-coded value with constant