IF and ELSE statements being executed

Thank you all, I dont have capacitors yet but the State idea worked. Thank you all