taking care of permissions