WebApp step: fixed a bug when calling onlySaveLatestState() and also implemented a new save function called overwriteLatestState()