Fix the connection error that gives after graph is cleaned