spawn wait fix