bug fix in callback