fix to global variable leak due to missing declaration