added implementation of callback