how to make an addon with custom driver function

i know how to make an addon and everything is working fine… other than ‘bpy.app.driver_namespace[“Driver”] = driver’
it works if i enable the addon when ever i start blender but if i save user preferences than it seems to not run that line of code but everything else works fine as far as i can tell

i have tried putting it in classes and in the register function but nothing works

Use a persistent load_post handler as shown here http://blender.stackexchange.com/a/71339/15543