Fix bug when closing sidr programatically