Issue #8677 by turegjorup: Added custom serialisation to middleware for screens