adding fileio permissions, and changes to db access