Fixed error when callback is undefined