wrote modal scroll function