Fixed a Bug while saving the permissions