Fixing issue with assigning directory permission.