Persisting lastID

Hopefully will fix once and for all the annoyance of repeated messages.