Fixed dependency problem and make config and callback safe.