overwriting  bakery_register_return function