added custom 404 page support and support for no posts