added controllor for error and index pages