added support for user callback