@imhs I figured it out! The problem was in the read function function where I call it every time toggling the run switch. Inside that function there is a timer which aims to read the registers and update the UI. Every time I call that function a new timer was generated. Therefore after sometime many timers was running in parallel which caused the problem. Take care about timers!