fixed problems with output