back function

works on the first click but stops working after that