split launch function for local and SSH cases