fix function updateTime() - create condition for victory and defeat