error handler updated for cleaner code
fixes to offline messaging. message display middleware with advanced features.