added a scrollto function to close