used callbacks instead of referencing hidden html elements