diff --git a/docs/source/conf.py b/docs/source/conf.py
index 861c746a..c2766881 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -28,7 +28,7 @@ copyright = f'{current_year}, CSC Developers'
 author = 'CSC Developers'
 
 # The full version, including alpha/beta/rc tags
-version = release = '0.3.2'
+version = release = '0.3.3'
 
 
 # -- General configuration ---------------------------------------------------
diff --git a/swift_browser_ui/__init__.py b/swift_browser_ui/__init__.py
index a1d3d29a..330337d2 100644
--- a/swift_browser_ui/__init__.py
+++ b/swift_browser_ui/__init__.py
@@ -7,6 +7,6 @@ with the object storage.
 
 
 __name__ = 'swift_browser_ui'
-__version__ = '0.3.2'
+__version__ = '0.3.3'
 __author__ = 'CSC Developers'
 __license__ = 'MIT License'
diff --git a/swift_browser_ui/middlewares.py b/swift_browser_ui/middlewares.py
index 3a857ab8..3f08bf77 100644
--- a/swift_browser_ui/middlewares.py
+++ b/swift_browser_ui/middlewares.py
@@ -5,41 +5,40 @@ from aiohttp import web
 from .settings import setd
 
 
+def return_error_response(error_code):
+    """Return the correct error page with correct status code."""
+    with open(
+            setd["static_directory"] + "/" + str(error_code) + ".html"
+    ) as resp:
+        return web.Response(
+            body="".join(resp.readlines()),
+            status=error_code,
+            content_type="text/html",
+            headers={
+                "Cache-Control": "no-cache, no-store, must-revalidate",
+                "Pragma": "no-cache",
+                "Expires": "0"
+            }
+        )
+
+
 @web.middleware
 async def error_middleware(request, handler):
     """Return the correct HTTP Error page."""
     try:
         response = await handler(request)
         if response.status == 401:
-            return web.FileResponse(
-                setd["static_directory"] + "/401.html",
-                status=401
-            )
+            return return_error_response(401)
         if response.status == 403:
-            return web.FileResponse(
-                setd["static_directory"] + "/403.html",
-                status=403
-            )
+            return return_error_response(403)
         if response.status == 404:
-            return web.FileResponse(
-                setd["static_directory"] + "/404.html",
-                status=404
-            )
+            return return_error_response(404)
         return response
     except web.HTTPException as ex:
         if ex.status == 401:
-            return web.FileResponse(
-                setd["static_directory"] + "/401.html",
-                status=401
-            )
+            return return_error_response(401)
         if ex.status == 403:
-            return web.FileResponse(
-                setd["static_directory"] + "/403.html",
-                status=403
-            )
+            return return_error_response(403)
         if ex.status == 404:
-            return web.FileResponse(
-                setd["static_directory"] + "/404.html",
-                status=404
-            )
+            return return_error_response(404)
         raise
diff --git a/tox.ini b/tox.ini
index ab953fc3..d983294d 100644
--- a/tox.ini
+++ b/tox.ini
@@ -16,7 +16,7 @@ deps =
     pydocstyle==3.0.0
     flake8
     flake8-docstrings
-commands = flake8 .
+commands = flake8 swift_browser_ui tests ui_tests
 
 [testenv:docs]
 ; skip_install = true

Failure to retrieve containers after switching to a a project with no containers
#### Describe the bug
Failure to retrieve containers after switching to a a project with no containers

#### To Reproduce
Steps to reproduce the behaviour:
1. Log in
2.1 If there is a project with some containers available switch to one without anything
2.2 If there is a project with no containers available switch to one with some containers
4. See error

#### Expected behavior
Display the available containers if they are present.

#### Screenshots
![Peek 2019-08-19 15-18](https://user-images.githubusercontent.com/47524/63264800-a45cbc00-c294-11e9-8368-698b6b43b2ba.gif)

#### Additional context
<!-- Add any other context about the problem here. -->

diff --git a/tests/test_middlewares.py b/tests/test_middlewares.py
index 84bad576..3c54417d 100644
--- a/tests/test_middlewares.py
+++ b/tests/test_middlewares.py
@@ -52,37 +52,37 @@ class MiddlewareTestClass(asynctest.TestCase):
         """Test 401 middleware when the 401 status is returned."""
         resp = await error_middleware(None, return_401_handler)
         self.assertEqual(resp.status, 401)
-        self.assertIsInstance(resp, FileResponse)
+        self.assertIsInstance(resp, Response)
 
     async def test_401_exception(self):
         """Test 401 middleware when the 401 status is risen."""
         resp = await error_middleware(True, return_401_handler)
         self.assertEqual(resp.status, 401)
-        self.assertIsInstance(resp, FileResponse)
+        self.assertIsInstance(resp, Response)
 
     async def test_403_return(self):
         """Test 403 middleware when the 403 status is returned."""
         resp = await error_middleware(None, return_403_handler)
         self.assertEqual(resp.status, 403)
-        self.assertIsInstance(resp, FileResponse)
+        self.assertIsInstance(resp, Response)
 
     async def test_403_exception(self):
         """Test 403 middleware when the 403 status is risen."""
         resp = await error_middleware(True, return_403_handler)
         self.assertEqual(resp.status, 403)
-        self.assertIsInstance(resp, FileResponse)
+        self.assertIsInstance(resp, Response)
 
     async def test_404_return(self):
         """Test 404 middleware when the 404 status is returned."""
         resp = await error_middleware(None, return_404_handler)
         self.assertEqual(resp.status, 404)
-        self.assertIsInstance(resp, FileResponse)
+        self.assertIsInstance(resp, Response)
 
     async def test_404_exception(self):
         """Test 404 middlewrae when the 404 status is risen."""
         resp = await error_middleware(True, return_404_handler)
         self.assertEqual(resp.status, 404)
-        self.assertIsInstance(resp, FileResponse)
+        self.assertIsInstance(resp, Response)
 
     async def test_error_middleware_no_error(self):
         """Test the general error middleware with correct status."""

pip install -e .[test]
parse_log_pytest_v2
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio
apt-get update apt-get install -y gcc
3.7
requirements.txt
pytest -xvs
aiohttp==3.8.6
aiosignal==1.3.1
alabaster==0.7.13
async-timeout==4.0.3
asynctest==0.13.0
attrs==24.2.0
Babel==2.14.0
certifi @ file:///croot/certifi_1671487769961/work/certifi
cffi==1.15.1
charset-normalizer==3.4.1
click==8.1.8
coverage==6.5.0
coveralls==3.3.1
cryptography==44.0.2
distlib==0.3.9
docopt==0.6.2
docutils==0.19
exceptiongroup==1.2.2
execnet==2.0.2
filelock==3.12.2
flake8==5.0.4
flake8-docstrings==1.7.0
frozenlist==1.3.3
gunicorn==23.0.0
idna==3.10
imagesize==1.4.1
importlib-metadata==4.2.0
iniconfig==2.0.0
iso8601==2.1.0
Jinja2==3.1.6
keystoneauth1==5.1.3
MarkupSafe==2.1.5
mccabe==0.7.0
multidict==6.0.5
os-service-types==1.7.0
packaging==24.0
pbr==6.1.1
platformdirs==2.6.2
pluggy==1.2.0
py==1.11.0
pycodestyle==2.9.1
pycparser==2.21
pydocstyle==6.3.0
pyflakes==2.5.0
Pygments==2.17.2
pytest==7.4.4
pytest-aiohttp==1.0.5
pytest-asyncio==0.21.2
pytest-cov==4.1.0
pytest-mock==3.11.1
pytest-xdist==3.5.0
python-swiftclient==4.7.0
pytz==2025.2
requests==2.31.0
six==1.17.0
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinx-rtd-theme==2.0.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
stevedore==3.5.2
-e git+https://github.com/CSCfi/swift-browser-ui.git@316d76f77f93701289188d0d461d4fc30fdccf96#egg=swift_browser_ui
tomli==2.0.1
tox==3.28.0
typing_extensions==4.7.1
urllib3==2.0.7
uvloop==0.18.0
virtualenv==20.16.2
yarl==1.9.4
zipp==3.15.0

name: swift-browser-ui
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - aiohttp==3.8.6
      - aiosignal==1.3.1
      - alabaster==0.7.13
      - async-timeout==4.0.3
      - asynctest==0.13.0
      - attrs==24.2.0
      - babel==2.14.0
      - cffi==1.15.1
      - charset-normalizer==3.4.1
      - click==8.1.8
      - coverage==6.5.0
      - coveralls==3.3.1
      - cryptography==44.0.2
      - distlib==0.3.9
      - docopt==0.6.2
      - docutils==0.19
      - exceptiongroup==1.2.2
      - execnet==2.0.2
      - filelock==3.12.2
      - flake8==5.0.4
      - flake8-docstrings==1.7.0
      - frozenlist==1.3.3
      - gunicorn==23.0.0
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.2.0
      - iniconfig==2.0.0
      - iso8601==2.1.0
      - jinja2==3.1.6
      - keystoneauth1==5.1.3
      - markupsafe==2.1.5
      - mccabe==0.7.0
      - multidict==6.0.5
      - os-service-types==1.7.0
      - packaging==24.0
      - pbr==6.1.1
      - platformdirs==2.6.2
      - pluggy==1.2.0
      - py==1.11.0
      - pycodestyle==2.9.1
      - pycparser==2.21
      - pydocstyle==6.3.0
      - pyflakes==2.5.0
      - pygments==2.17.2
      - pytest==7.4.4
      - pytest-aiohttp==1.0.5
      - pytest-asyncio==0.21.2
      - pytest-cov==4.1.0
      - pytest-mock==3.11.1
      - pytest-xdist==3.5.0
      - python-swiftclient==4.7.0
      - pytz==2025.2
      - requests==2.31.0
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinx-rtd-theme==2.0.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - stevedore==3.5.2
      - tomli==2.0.1
      - tox==3.28.0
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - uvloop==0.18.0
      - virtualenv==20.16.2
      - yarl==1.9.4
      - zipp==3.15.0
prefix: /opt/conda/envs/swift-browser-ui

tests/test_middlewares.py::MiddlewareTestClass::test_401_exception tests/test_middlewares.py::MiddlewareTestClass::test_401_return tests/test_middlewares.py::MiddlewareTestClass::test_403_exception tests/test_middlewares.py::MiddlewareTestClass::test_403_return tests/test_middlewares.py::MiddlewareTestClass::test_404_exception tests/test_middlewares.py::MiddlewareTestClass::test_404_return tests/test_middlewares.py::MiddlewareTestClass::test_error_middleware_no_error tests/test_middlewares.py::MiddlewareTestClass::test_error_middleware_non_handled_raise
swift_browser_ui/middlewares.py tox.ini swift_browser_ui/__init__.py docs/source/conf.py
swift_browser_ui/middlewares.py tox.ini swift_browser_ui/__init__.py docs/source/conf.py