refactor errors on home page