fixed critical bugs in common.lua #55