Don't use select to write because it generates some weird loops. Still dump core problem