Can you post your code formatted? Maybe there are some indents wrong…
You can format your code using three backticks (`) before and after the code. Also make sure, the code you posted is indented the same way as the code you executed, because otherwise we won’t be aple to reproduce this.