Checked by JSLint. Fixed the permission asking issue.