added a clear callback option
added clear callback