some code add for permission