example about pass state to callback