Removed unnecessary operator 'if' and logs, resolve #1