debuging an sh's bug