Make popup boxes never go off the screen