improve shell detection