moved everything to resolve for avoiding flickering