fixed #705,fixed the flicker issue by introducing settimeout