Fix some bugs.Add viewport