improved startup sequence to not save when DEBUG flag is set.