only call a function if it exists