fix scroll function