Added buttons to second page and fixed bugs