Added a function to attach the AutoloadCallback automatically