James proglem
fix logical problem
test