Fixed bug in permission