added permission checks