Add to history table after the timestamp has been prepended

Tested on server. Works fine.