issues with code stopping after ssh logout, restarting