Fix bug occuring when no error callback provided