fix a bug in gamedata
add testcase for new function