fix showing duration after refresh page