correct logic error

Signed-off-by: Stephano Cetola <scetola@reachtech.com>