Fix function not being called