Make  a function
Rerender viewport properly after resize