fixed some logical error

Signed-off-by: Nicholas Tan Jerome <nicholas.jerome@kit.edu>