fix bugs and create test from interval/timeout