fix throw
refactor global variable table