moved scroll function to view