fixed writeln()

small fix but incredibly useful for debugging 
This is a potential segfault