fix a bug for bash < 4.2