Fix undefined variable  in handlers.