fixed output bug