permissions and optimize

Change-Id: Ie04b390a683cf83a9fe9bca252551e6a02ab507d