added permissions handler