workaround not catching socket listening event in time