A gradient sensing middleware to handle flash flood