Fix missing callback-fun
Improve codes with dialyzer