Permissions added and bug fixes