Add base hook for replacing math