fixed some errors with output