get permission at the beginning