add test id handling in psmActivity and add some state saving