fixed several permissions issues