Fix function override bug