fixed callback may not be defined
sync with master