fixed bug with comparing wrong viewport variables