Updated to use the shell to to find the shell rather than relying on