Use threadDelay instead of putStrLn to work around a bug