Add tests, better connection handling and call next immediatly