Fix for permissions check