Added sleep when waiting for open port