added session if and ifend