added switchclient support and make sure we use file from home directory