fix direct access security, missing parentheses and commenting