js and css array read func moved to controller