fixed back button causing errors on last page