Fixes #5772 adds check for title being valid before adding header to main layout area