fixed incorrect output