fixed scrool function