In our code style we always using curly braces with "if" statements. Please add them and bear it in mind for future especially when you are copy-pasting solution which you've found somewhere in Internet =)