Added method to redirect back to previous page