added permission hook