fix credential switch on os x and not break it on linux