First I don't see how that compiles because from what I see you have an unclosed if condition at the start, also that condition is hard to read as is, start by using this format on it:
Code:
if
(
cond
&& cond
&& cond
&& etc...
)
Finally I don't see any enclosing code block brackets encasing the code to execute, as it stands it looks like on fail it will skip only the first code statement after the if statement then continue with whatever code follows that statement, fix those 2 points 1st then I'll look again to see where else you're going wrong