replaced anonymous function with named function declared outside of on d...

...oc ready