Chmod fix

fixed bug where permission weren't set on new files being uploaded.