fix undeclared variable assignment in lib/handler