upated missing brace on if statement