ensure callback is a function
fix for issue #12 - thanks @magebarf