Extension of Lyapunov stability theory for hybrid systems