Adding sleep to avoid segfault