refactor loader
use timer instead of transitionend event