fixing reference problem; fixing autoload