only callback if one is specified. prevent undefined exception