Fixed bug in permissions