Fixes 500 and delete permissions