fixed the viewport and player refresh