Added 1ms Sleep in end() to ensure printing errors in order