Ensure callback is a function before adding