fix creating data handler
not tested yet