fixed if statements by introducting any, thx @gidoca