update part of code;
add authorization control.