Fixed a bug of viewport