fix a bug when not using a login shell