changed permission registration
this should prevent permissions havong memoryleak