some minor changes

in some cases the program still dies