add checks at script begin
remove unused line