added preventGoingBack