Move list declaration into callback