"lua_pop(tolua_S, 1);" should be added to avoid the change of the top to stack.