fix scope issue in card build function