Added scroll function to layouts