Added slide duration logic