adds viewport recognition.