removed unnecessary local variable definition and fixed code style errors
check if hideAttr was set instead of forcing users to set it to string "1"