Shell is not successfully exiting