fix in function f_shutdown(){ - if loop