Only set callback if it is passed