added cycle for sending msgs