fixed bug in update_viewport