This might end up taking a lot of time. Should there be a timeout  ?