add if scrollTo statement
remove extra close curly brace