added more stuff to check the gateway retrieve