bugfix (dont try to kill repl if it is already closed)