scroll event and variables inside scroll event work