fixed database file permission bug