fixed crash on empty TERM env variable