remove debugging and add guard to updatesegusg