moved scroll code to panel