simplified the [[ test ]] to work in older bash shells