Fixed logical error/compiler warning

Special Thanks to bgamez23

Signed-off-by: shennetsind <ind@henn.et>