javascript call overridden function