supporting testmode and testing