added new function for previous next conents