fixed input parsing