added support of context in callback function