some debug funcitons