Fix operation not permitted IO exception