add countdown & fix potential bug