             lastCommands = JSON.parse(localStorage.getItem(@localStorageCommandLineInputKeyPrefix + @id))
         catch e
             console.error('Could not parse previous commands JSON')
-            lastCommands = [lastCommands.length - 1]
+            lastCommands = []
         vex.dialog.prompt
             message: "<h3>Run Task</h3>"
             input: runTemplate

                fileName = @data.filename.trim()
                message = @data.message

                if fileName.length is 0 and @data.autoTail is 'on'
                    $(window.noFilenameError).removeClass('hide')
                    return false


                        fileName = @data.filename.trim()
                        commandLineInput = @data.commandLineInput.trim()

                        if fileName and fileName.length is 0 and @data.autoTail is 'on'
                            $(window.noFilenameError).removeClass('hide')
                            return false

