make shure the context is initialized before resizing the viewport