fix sudo logic