allow handling of callback function with canvas context