Fixed bug when no callback function provided