Timeouts and persistent events work together

1. Timeouts and persistent events work together
2.

Signed-off-by: spriteray <spriteray@gmail.com>