fix slide function