Fixed adding permissions

Was broken by somebody writing over the old commit... grrr