changes to code to enable online/offline testing