tweaked tracking module to fix undefined bug