add postmessage, clean inputs