:wrench: :joy: fixed double db write by moving xhr from onmssg to onopen onclose and onkeypress