Fixed permissions.
Changed data object so that it is now checked to prevent double stringify