Added suport of callback function