fixed problem of incorrect input