Add check if register function exists, if not throw Error

I try but not work.