fixed bug in callback