header/footer, fixed problems with error messages etc