had to add 'that' to get elements scoped within functions