added next screen and previous screen logic