fix warning for function